<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>
BaseApplication class
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../resources/stylesheet.css" TITLE="Style">
</HEAD>

<BODY BGCOLOR="white">


<!-- ========= START OF TOP NAVBAR ======= -->

<table border="0" width="100%">
<tr>
<td width="50%">
<p align="left">
<a href="http://mvvmbasics.mobilemotion.eu/" target="_blank" title="MVVMbasics Homepage"><img src="../resources/logo_mvvmbasics.png" alt="MVVMbasics Logo" border="0"></a>
</p>
</td>
<td width="50%">
<p align="right">
<a href="http://www.mobilemotion.eu/" target="_blank" title="mobilemotion.eu Homepage"><img src="../resources/logo_mobilemotion.png" alt="mobilemotion.eu Logo" border="0"></a>
</p>
</td>
</tr>
</table>

<HR>

<p><a href="../index.htm" title="MVVMbasics Class Reference Homepage">Back to Class Reference home page</a></p>

<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">MVVMbasics</FONT>
<BR>
Class BaseApplication
</H2>

<CODE>
<a href="http://msdn.microsoft.com/library/windows/apps/br242324" target="_blank" title="Windows.UI.Xaml.Application">Windows.UI.Xaml.Application</a> | <a href="http://msdn.microsoft.com/en-us/library/system.windows.application%28v=vs.110%29.aspx" target="_blank" title="System.Windows.Application">System.Windows.Application</a> | <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/system.windows.application%28v=vs.105%29.aspx" target="_blank" title="System.Windows.Application">System.Windows.Application</a>
<br>
&nbsp;&nbsp;<IMG SRC="../resources/inherit.gif" ALT="extended by "><B>MVVMbasics.BaseApplication</B>
<br>&nbsp;
</CODE>
<HR>
<CODE>
&nbsp;<br>
public class <B>BaseApplication</B> : <a href="http://msdn.microsoft.com/library/windows/apps/br242324" target="_blank" title="Windows.UI.Xaml.Application">Windows.UI.Xaml.Application</a> | <a href="http://msdn.microsoft.com/en-us/library/system.windows.application%28v=vs.110%29.aspx" target="_blank" title="System.Windows.Application">System.Windows.Application</a> | <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/system.windows.application%28v=vs.105%29.aspx" target="_blank" title="System.Windows.Application">System.Windows.Application</a>
</CODE>

<P>
Base Application class the phone application can be derived from.
</P>

<hr>

<!-- ======== PROPERTY SUMMARY ======== -->

<A NAME="property_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Property Summary</B></FONT></TH>
</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">
<TD>
<CODE>public <a href="Helpers/ServiceLocator.htm" title="ServiceLocator">ServiceLocator</a> <B>ServiceLocator</B> { get; private set; }</CODE>
<BR>
<span class="Indented"><a href="Helpers/ServiceLocator.htm" title="ServiceLocator">ServiceLocator</a> instance that can be used throughout the application. Services should be registered to it in the BaseApplication's constructor. This ServiceLocator instance will be passed on to all Viewmodels.</span>
</TD>
</TR>
</TABLE>
&nbsp;

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>public&nbsp;</CODE></FONT></TD>
<TD>
<CODE><B><a href="#BaseApplication()">BaseApplication</a></B>()</CODE>
<BR>
<span class="Indented">Constructor. Registers a PhoneApplicationService event to the application that contains implementations of the Launching, Activated, Deactivated, and Closing events.</span>
</TD>
</TR>

</TABLE>
&nbsp;

<!-- ======== METHOD SUMMARY ======== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>virtual void&nbsp;</CODE></FONT></TD>
<TD>
<CODE><B><a href="#OnLaunching(object,LaunchingEventArgs)">OnLaunching</a></B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.launchingeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.LaunchingEventArgs">LaunchingEventArgs</a> e)</CODE>
<BR>
<span class="Indented">Method that is executed when the application is launching (eg, from Start), but not when the application is reactivated.</span>
</TD>
</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>virtual void&nbsp;</CODE></FONT></TD>
<TD>
<CODE><B><a href="#OnActivated(object,ActivatedEventArgs)">OnActivated</a></B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.activatedeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.ActivatedEventArgs">ActivatedEventArgs</a> e)</CODE>
<BR>
<span class="Indented">Method that is executed when the application is activated (brought to foreground), but not when the application is first launched.</span>
</TD>
</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>virtual void&nbsp;</CODE></FONT></TD>
<TD>
<CODE><B><a href="#OnDeactivated(object,DeactivatedEventArgs)">OnDeactivated</a></B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.deactivatedeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.DeactivatedEventArgs">DeactivatedEventArgs</a> e)</CODE>
<BR>
<span class="Indented">Method that is executed when the application is deactivated (sent to background), but not when the application is closing.</span>
</TD>
</TR>

<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>virtual void&nbsp;</CODE></FONT></TD>
<TD>
<CODE><B><a href="#OnClosing(object,ClosingEventArgs)">OnClosing</a></B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.closingeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.ClosingEventArgs">ClosingEventArgs</a> e)</CODE>
<BR>
<span class="Indented">Method that is executed when the application is closing (eg, user hit Back), but not when the application is deactivated.</span>
</TD>
</TR>

</TABLE>
&nbsp;

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="Register(object)"><!-- --></A><H3>
BaseApplication</H3>
<CODE>public <B>BaseApplication</B>()</CODE>
<p class="Indented">Constructor. Registers a PhoneApplicationService event to the application that contains implementations of the Launching, Activated, Deactivated, and Closing events.</p>

<!-- ========= METHOD DETAIL ======== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="OnLaunching(object,LaunchingEventArgs)"><!-- --></A><H3>
OnLaunching</H3>
<CODE>public virtual void <B>OnLaunching</B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.launchingeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.LaunchingEventArgs">LaunchingEventArgs</a> e)</CODE>
<p class="Indented">Method that is executed when the application is launching (eg, from Start), but not when the application is reactivated.<br>
Subclasses can override this method to run custom code when the application is launching.</p>

<hr>

<A NAME="OnActivated(object,ActivatedEventArgs)"><!-- --></A><H3>
OnActivated</H3>
<CODE>public virtual void <B>OnActivated</B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.activatedeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.ActivatedEventArgs">ActivatedEventArgs</a> e)</CODE>
<p class="Indented">Method that is executed when the application is activated (brought to foreground), but not when the application is first launched. If the application is reactivated from tombstoning, sets a flag to the currently active view to indicate that ViewState must be set to Awakaned.<br>
Subclasses can override this method to run custom code when the application is activated, but should not forget to add a call to <code>base.OnActivated(sender, e)</code>.</p>

<hr>

<A NAME="OnDeactivated(object,DeactivatedEventArgs)"><!-- --></A><H3>
OnDeactivated</H3>
<CODE>public virtual void <B>OnDeactivated</B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.deactivatedeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.DeactivatedEventArgs">DeactivatedEventArgs</a> e)</CODE>
<p class="Indented">Method that is executed when the application is deactivated (sent to background), but not when the application is closing.<br>
Subclasses can override this method to run custom code when the application is deactivated.</p>

<hr>

<A NAME="OnClosing(object,ClosingEventArgs)"><!-- --></A><H3>
OnLaunching</H3>
<CODE>public virtual void <B>OnClosing</B>(object sender, <a href="http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.closingeventargs%28v=vs.105%29.aspx" target="_blank" title="Microsoft.Phone.Shell.ClosingEventArgs">ClosingEventArgs</a> e)</CODE>
<p class="Indented">Method that is executed when the application is closing (eg, user hit Back), but not when the application is deactivated.<br>
Subclasses can override this method to run custom code when the application is closing.</p>

<!-- ========= END OF CLASS DATA ========= -->
<HR>

</body>
</HTML>